package com.liao.rent.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 房源出租记录表
 * </p>
 *
 * @author liao
 * @since 2024-12-06
 */
@Getter
@Setter
@TableName("house_record")
@Schema(description ="住房记录对象")
public class HouseRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(title ="出租记录id")
    @TableId(value = "record_id", type = IdType.AUTO)
    private Integer recordId;

    @Schema(title = "房源id")
    @TableField("house_id")
    private Integer houseId;

    @Schema(title ="联系人姓名")
    @TableField("contact_name")
    private String contactName;

    @Schema(title ="联系人手机号")
    @TableField("contact_phone")
    private String contactPhone;

    @Schema(title ="上次入住时间")
    @TableField("last_start_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastStartTime;

    @Schema(title ="入住结束时间")
    @TableField("last_end_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastEndTime;

    @Schema(title ="创建人")
    @TableField(value = "create_user",fill = FieldFill.INSERT)
    private Integer createUser;

    @Schema(title ="创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(title ="更新人")
    @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;

    @Schema(title ="更新时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
